<?php
/*
**************************************************************************
*  File: index.php
*  Text Format: UTF-8 (NO BOM)
*  (c) Extreme Portal Light Version 2012-2014
*  By elwizard. All rights reserved.
*  http://www.mgsteam.es
*
*  This program is free software under MGS License Agreement. 
*  You cannot distribute in any way. For modifications, please read 
*  MGS License Agreement for more information.
*
**************************************************************************
*/

class template {

function header($stylesheet, $AJAX) {
global $ext, $global;

  
return <<<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Elwizard &amp; MGS Team web oficial - (c) 2012-2014 por Elwizard</title>
<meta name="description" content="Herramientas para usuarios en PHP y MySQL. Esta es una web de dise??e PHP y MYSQL, que proporciona herramientas para webmasters." />
<meta name="keywords" content="elwizard, MGS Team, tools, MGS, php, mysql, html, css, xhtml, cms" />
<meta http-equiv="title" content="MGS Team official website" />
<meta name="author" content="MGS Team - elwizard" />
<meta content="Copyright (c) por Magic Games Software - elwizard" name="copyright" />
<meta name="vw96.objectype" content="Document" />
<meta name="resource-type" content="Document" />
<meta name="distribution" content="all" />
<meta name="robots" content="all" />
<meta name="language" content="sp" />
<meta name="revisit" content="10 days" /> 
<meta content="general" name="rating" />
<meta content="global" name="distribution" />
<meta content="Extreme Portal 1.0" name="generator" />
$stylesheet
<link href="{$global['website']}favicon.ico" rel="SHORTCUT ICON" />
$AJAX

<script src="include/jquery.js" type="text/javascript"></script>
<script src="include/jquery.magnifier.js" type="text/javascript">

/***********************************************
* jQuery Image Magnify- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<script type="text/javaScript">
<!--

//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// --> 

/* crea una cookie */
function createCookie1(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function toggle_visibility(id, id1) {

       var e = document.getElementById(id);
       var f = document.getElementById(id1);
       if(e.style.display == 'block') {
          e.style.display = 'none';
          f.src = "templates/default/images/plus-sign.png";
          createCookie1('{$global['website_cookie']}_'+id,'display:none',365);
       } else {
          e.style.display = 'block';
          f.src = "templates/default/images/minus-sign.png";
          createCookie1('{$global['website_cookie']}_'+id,'display:block',365);
       }
}

</script>


</head>
<body class="background" dir="{$ext->config['portal_direction']}">
EOF;
}

function open_main() {
global $ext;
return <<<EOF
<table style="border: 0px; width: 100%; margin: 0px; padding-top: 0px; background: #f0f0f0; border-collapse: collapse;">
<tr>
<td align="center">
<div style="width: 900px; border-collapse:collapse;">
<div class="wrapper">


<table class="tabmain">

  <tr>
    <td class="gborder_left">&nbsp;</td>   
    <td style="width: 878px;" align="center" valign="top">
      <table width="100%" cellpadding="0" cellspacing="0" style="border: 0px; border-collapse:collapse;">
EOF;
}

function view_logo() {
global $global;

return <<<EOF
	<tr>
	  <td id="header" align="left">
	  	<a href="{$global['website']}/index.php" title="Main page"><img src="{$global['website']}/templates/default/images/logo.jpg" alt="" style="border: 0px;" /></a>
    </td>
  </tr>
EOF;
}

function open_body() {
  global $ext;

$mainnavbar = "
<tr class=\"content\">
    <td align=\"center\">
    	
	    <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"730px\">
	      <tr>
	        <td class=\"linkstrip\">
<ul id=\"nav\">
  <li class=\"tleft\"></li>
	<li class=\"top\"><a href=\"{$ext->siteurl}/\" class=\"top_link\"><span>Inicio</span></a></li>
	<li class=\"sep\">&nbsp;</li>
	<li class=\"top\"><a href=\"support\" class=\"top_link\"><span>Foros soporte</span></a></li>
	<li class=\"sep\">&nbsp;</li>
	<li class=\"top\"><a href=\"javascript:void(0)\" id=\"products\" class=\"top_link\"><span class=\"down\">Productos</span></a>
		<ul class=\"sub\">
		  <li><a href=\"support/forumdisplay.php/6-Extreme-Portal-Light-Version\">Extreme Portal</a></li>
		  <li><a href=\"support/forumdisplay.php/10-Extreme-Smilies\">Extreme Smileys</a></li>
		</ul>
	</li>
	<li class=\"sep\">&nbsp;</li>
	<li class=\"top\"><a href=\"javascript:void(0)\" id=\"services\" class=\"top_link\"><span class=\"down\">Servicios</span></a>
		<ul class=\"sub\">
		  <li><a href=\"index.php?contact\">Contacto</a></li>
		  <li><a href=\"support/showthread.php/3-¿Quieres-formar-parte-del-grupo-MGS-Team\">Deseo ayudar</a></li>
		  <li><a href=\"index.php?link_us\">Enl?nos</a></li>
		  <li><a href=\"support/forumdisplay.php/32-Intercambios-de-enlaces-Links-exchange\">Intercambio enlaces</a></li>
		</ul>
	</li>
	<li class=\"sep\">&nbsp;</li>
	<li class=\"top\"><a href=\"javascript:void(0)\" id=\"aboutus\" class=\"top_link\"><span class=\"down\">El grupo</span></a>
		<ul class=\"sub\">
		  <li><a href=\"index.php?about_us\">¿Quienes somos?</a></li>
		  <li><a href=\"support/showthread.php/4-Equipo-MGS-Team?p=4#post4\">Miembros</a></li>
		</ul>
	</li>
	<!--
	<li class=\"sep\">&nbsp;</li>
	<li class=\"top\"><a href=\"javascript:void(0)\" id=\"langs\" class=\"top_link\"><span class=\"down\">Idiomas</span></a>
		<ul class=\"sub\">
		  <li><a href=\"index.php?language-es\"><img src=\"templates/default/images/f-es.gif\" alt=\"Seleccionar Espa??Espa?? style=\"border: 0px;\" /> Espa??</a></li>
		  <li><a href=\"index.php?language-cat\"><img src=\"templates/default/images/f-cat.gif\" alt=\"Sel.leccionar Catal?tyle=\"border: 0px;\" /> Catal?li>
		  <li><a href=\"index.php?language-en\"><img src=\"templates/default/images/f-uk.gif\" alt=\"Select English lang (uk)\" style=\"border: 0px;\" /> English</a></li>
		</ul>
	</li>
	-->
	<li class=\"tright\"></li>
</ul>
<br />
  <!-- FIN MENU-->
          </td>
        </tr>
      </table>
      
    </td>
	</tr>
    ";

if ((!$ext->config['portal_active']) || (!$ext->config['navbar_active']))
  $mainnavbar = "";

return <<<EOF
	{$mainnavbar}
	
	<tr align="center" class="content">
	  <td>

EOF;
}

function close_body() {
  global $global;
return <<<EOF

	  </td>
	</tr>
	
	<tr>
	  <td id="footer">
	  	 <span style="color: black;">
            <!-- WARNING: YOU ARE NOT ALLOWED TO MODIFY OR DELETE THIS CREDITS IN ANY WAY. YOUR LICENSE WILL BE BROKEN AND YOU WILL LOSE ALL RIGHTS. -->
            <!-- ATENCI?: NO TIENES PERMISO PARA MODIFICAR O BORRAR LOS SIGUIENTES CR?ITOS DE NINGUNA MANERA. PERDER TU LICENCIA Y TODOS TUS DERECHOS SI LO HACES. -->
            &copy; 2010-2012 <a href="http://www.elwizard.es" title="MGS Team Homepage">Extreme Portal</a> Light Version v. 0.1 ALFA 1 + vBulletin integration by elwizard - MGS Team.<br />
            <br />
            <img src="{$global['website']}/images/logo.jpg" alt="" style="border: 0px;" />
            <!-- END WARNING -->
            <br /><br />
        </span>
    </td>
  </tr>
EOF;
}

function close_main() {

return <<<EOF
	
      </table>
    </td>
    <td class="gborder_right">&nbsp;</td>  
    
  </tr>

</table>
<!-- GRAFICOS BOTTOM -->
<table style="width: 900px; border-collapse: collapse; margin: 0px; padding: 0px; border: 0px;">
	<tr>
		<td class="gborder_bottom_left"></td>
		<td class="gborder_bottom_center"></td>
		<td class="gborder_bottom_right"></td>
  </tr>
</table>
	



</div>
</div>
</td>
</tr>
</table>
EOF;
}

function footer() {
global $ext, $DB;

return <<<EOF
</body></html>
EOF;
}


function view_column_left($blocks) {
global $ext;
return <<<EOF
    <div id="left_col">
		<td valign="top" style="width: 181px; text-align: right; padding-left: 5px">
		  <table width="100%" cellpadding="0" cellspacing="0" border="0">
		  
		  {$blocks}
		  
		  </table>
		</td>
		</div>
  
EOF;
}


function view_column_right($blocks) {
global $ext;
return <<<EOF
    <div id="right_col">
		<td valign="top" style="width: 181px; text-align: right; padding-left: 15px">
		  <table width="100%" cellpadding="0" cellspacing="0" border="0">
		  
		  {$blocks}
		  
		  </table>
		</td>
    </div>
EOF;
}


function view_column_center($blocks) {
global $ext;

return <<<EOF
		<td valign="top" style="padding-left: 5px">
		  <table width="100%" cellpadding="1" cellspacing="1" border="0">

           {$blocks}

		  </table>
		</td>
EOF;
}




function view_block($title, $content, $id) {
global $global;

$mycookie = $global['website_cookie'].'_extblock'.$id;
if (isset($_COOKIE[$mycookie])) {
  $thisstyleblock = $_COOKIE[$mycookie];
  
  if ($thisstyleblock=="display:block")
	    $iconplace = "minus-sign.png";
	  else
	    $iconplace = "plus-sign.png";
  
} else {
	if ($display!="") {
	  $thisstyleblock = "display:{$display}";
	  if ($display=="block")
	    $iconplace = "plus-sign.png";
	  else
	    $iconplace = "minus-sign.png";
  } else {
    $thisstyleblock = "display:block";
    $iconplace = "minus-sign.png";
  }
}

return <<<EOF
		    <tr>
		      <td valign="top" style="width: 181px">
		      	
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse">
	<tr>
     <td class="blocktitle">
			 <div style="background: transparent; float: left; padding-left: 15px">
		      {$title}
		    </div>
		    <div style="background: transparent; float: right; padding-right: 5px">
		      <img id="exta{$id}" onclick="toggle_visibility('extblock{$id}', 'exta{$id}'); return false;" src="templates/default/images/{$iconplace}" />
		    </div>
		 </td>
  </tr>
 
  <tr>
    <td class="tdblock" colspan="2">
		  
		  <div id="extblock{$id}" style="{$thisstyleblock}">
		  <table border="0" width="100%" cellpadding="0" cellspacing="0">
		    {$content}
      </table>
      </div>
      
    </td>
 </tr>
 
 <tr>
     <td class="blockbottom">
		 </td>
 </tr>
 
 </table>
 </td>
 </tr>
	
	<tr>
	  <td class="tdspacer">&nbsp;
		</td>
	</tr>
	
EOF;

}

function view_module($title, $content, $id) {
global $global;
	
$mycookie = $global['website_cookie'].'_extblock'.$id;
if (isset($_COOKIE[$mycookie])) {
  $thisstyleblock = $_COOKIE[$mycookie];
  
  if ($thisstyleblock=="display:block")
	    $iconplace = "minus-sign.png";
	  else
	    $iconplace = "plus-sign.png";
  
} else {
	if ($display!="") {
	  $thisstyleblock = "display:{$display}";
	  if ($display=="block")
	    $iconplace = "plus-sign.png";
	  else
	    $iconplace = "minus-sign.png";
  } else {
    $thisstyleblock = "display:block";
    $iconplace = "minus-sign.png";
  }
}

return <<<EOF
		    <tr>
		      <td valign="top" style="width: 655px">
		      	
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="655px">
	<tr>
     <td class="moduletitle">
			 <table cellpadding="0" cellspacing="0" style="border-collapse: collapse; width: 100%; border: 0px; ">
       <tr>
         <td style="color: #800000; font-weight: bolder; font-size: 15px; text-align: center">
           {$title}
         </td>
         <td style="width:5%; padding-right: 10px">
           <img id="exta{$id}" onclick="toggle_visibility('extblock{$id}', 'exta{$id}'); return false;" src="templates/default/images/{$iconplace}" style=" float: right; padding-right: 10px" />
         </td>
       </tr>
       </table>
		 </td>
  </tr>
  <tr>
    <td class="tdmodule">
		  
		  <div id="extblock{$id}" style="{$thisstyleblock}">
		  <table border="0" width="100%" cellpadding="0" cellspacing="0">
		    {$content}
      </table>
      </div>
    
    </td>
 </tr>
 
 <tr>
     <td class="modulebottom">
		 </td>
 </tr>
 
 </table>
 </td>
 </tr>
	
	<tr>
	  <td class="tdspacer">&nbsp;
		</td>
	</tr>
	
EOF;
}

function view_module_empty($title, $content) {

return <<<EOF
		    <tr>
		      <td valign="top" style="width: 100%">
		      	
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse">
	<tr>
     <td>
			 $title   
		 </td>
  </tr>
  <tr>
    <td>
		
		  <table border="0" width="100%" cellpadding="0" cellspacing="0">
		    {$content}
      </table>
    
    </td>
 </tr>
 
 </table>
 </td>
 </tr>
	
	<tr>
	  <td class="tdspacer">&nbsp;
		</td>
	</tr>
	
EOF;
}

function get_contents($title, $title2, $content1) {

return <<<EOF
		    <tr>
		      <td valign="top" style="width: 800px" class="bmodulecontent">
		      	
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="800px">
	<tr>
     <td class="moduleheader">
			 $title
		 </td>
  </tr>
  <tr>
    <td class="modulecontent">
		
		  <table border="0" width="100%" cellpadding="0" cellspacing="4">
		    {$content1}
      </table>
    
    </td>
 </tr>
 
 <tr>
     <td class="modulebottom1">
		 </td>
 </tr>
 
 </table>
 </td>
 </tr>	
EOF;
}



} // end class

$tpl = new template;

?>